package MidAutumnFestival;

import java.util.Scanner;

//6)、从键盘输入3个数（其中一个数用来代表加减乘除的符号，其余两个数用来计算），用来进行加/减/乘/除/取余
public class Test6 {
    public static void main(String[] args) {
        Scanner input = new Scanner(System.in);
        System.out.println("请输入2个数：");
        int a = input.nextInt();
        int b = input.nextInt();
        System.out.println("请选择计算符号：\n1.加\t2.减\t3.乘\t4.除\t5.取余");
        int c = input.nextInt();
        if (c < 1 || c > 5) {
            System.out.println("请选择1~5");
        } else if (c == 1) {
            System.out.println(a + "+" + b + "=" + (a + b));
        } else if (c == 2) {
            System.out.println(a + "-" + b + "=" + (a - b));
        } else if (c == 3) {
            System.out.println(a + "*" + b + "=" + (a * b));
        } else if (c == 4) {
            System.out.println(a + "/" + b + "=" + (a / b));
        } else {
            System.out.println(a + "%" + b + "=" + (a % b));
        }

    }
}
